feat(cli): default output to JSON for coding agents#5532
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 333917938d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase@5532Preview package for commit |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c907b6cdf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2f5e4c66b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Coding agents that run the CLI now get JSON output by default, so they can parse structured results instead of scraping human-formatted tables. I resolve the effective output format once at the TypeScript entrypoint (both the legacy and next roots): an explicit
--output/--output-formatalways wins, otherwise a detected coding agent getsjsonand everyone else keepstext. For Go-proxied commands this flows down as--output jsonto the Go subprocess, which renders JSON for the data-returning commands and ignores the flag elsewhere, so no Go changes were needed.Changes
jsonwhen no format is set explicitly.resolveAgentOutputFormathelper (explicit ?? (agent ? json : text)) reused by both roots, with unit tests.--output-formatglobal flag optional so an explicitly-passed format is distinguishable from the default.-o/--outputflag is passed explicitly:-o json|yaml|toml|envalready short-circuits inside handlers, and-o prettynow keeps rendering the human table on natively ported commands instead of being overridden to JSON.Behavior notes
{"_tag":"Error","error":{code,message}}) on stdout with a non-zero exit code, the same behavior--output-format jsonalready had, so agents get parseable failures instead of prose.NonInteractiveError), so a detected agent cannot hang on a confirm prompt.--helpand--versionrender before the output layer engages and stay text in both roots.--agent yes|nooverrides detection in both directions for the default-format decision.Linear